* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2a 100%);
    color: #e0e0ff;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    padding-top: 180px;
    /* 为固定头部留出空间 */
}

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #2a2a4a;
    position: fixed;
    top: 0;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2a 100%);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.5rem;
    color: #6c63ff;
    text-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    color: #a0a0cc;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.resource-path {
    background: rgba(42, 42, 74, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    font-family: monospace;
    color: #6c63ff;
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
}

.container {
    display: flex;
    flex: 1;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.table-container {
    flex: 3;
    background: #1a1a2a;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a4a;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    /* 限制高度以启用滚动 */
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background: #1a1a2a;
    z-index: 10;
    padding: 10px 0;
}

.refresh-btn {
    background: #2a2a4a;
    color: #a0a0cc;
    border: 1px solid #6c63ff;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #6c63ff;
    color: white;
}

.button-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #1a1a2a;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a4a;
    position: sticky;
    top: 180px;
    max-height: calc(100vh - 220px);
    /* 限制高度 */
}

table {
    width: 100%;
    border-collapse: collapse;
    flex: 1;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #2a2a4a;
}

th {
    background-color: #2a2a4a;
    color: #6c63ff;
    font-weight: 600;
    position: sticky;
    top: 60px;
    /* 表头固定位置 */
    z-index: 5;
}

tbody {
    display: block;
    max-height: calc(100vh - 350px);
    /* 表格内容区域可滚动 */
    overflow-y: auto;
}

thead,
tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

tr:hover {
    background-color: #2a2a4a;
}

.file-path {
    color: #a0a0cc;
    font-family: monospace;
    font-size: 0.9rem;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.merge-btn {
    background: linear-gradient(135deg, #6c63ff 0%, #4a40e5 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.4);
    transition: all 0.3s ease;
    margin-bottom: 30px;
    width: 100%;
    max-width: 250px;
}

.merge-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.6);
}

.merge-btn:active {
    transform: translateY(1px);
}

.status {
    margin-top: 20px;
    text-align: center;
    color: #a0a0cc;
    display: none;
}

.instructions {
    background: #2a2a4a;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.cockpit-status {
    background: #2a2a4a;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
    border-left: 4px solid #6c63ff;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #6c63ff;
    border-top: 1px solid #2a2a4a;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2a;
    z-index: 1000;
}

@media (max-width: 768px) {
    body {
        padding-top: 250px;
        /* 移动端增加顶部空间 */
        padding-bottom: 100px;
        /* 移动端增加底部空间 */
    }

    .container {
        flex-direction: column;
    }

    .table-container,
    .button-container {
        width: 100%;
        max-height: none;
    }

    .button-container {
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }

    header,
    footer {
        position: relative;
        left: 0;
        right: 0;
    }

    tbody {
        max-height: none;
        overflow-y: visible;
    }
}